package com.lms.controller;

import com.lms.entity.Dinebuildbaseinfo;
import com.lms.service.DinebuildbaseinfoService;
import com.lms.vo.DataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Description: 餐饮建筑基础信息控制器类
 * @author: L-B-S
 * @Date: 2021/3/17 19:48
 * @modified_By:
 * @Version: 0.0$
 */
@Controller
public class DinebuildbaseinfoController {

    @Autowired
    private DinebuildbaseinfoService dineBuildBaseInfoService;

    @ResponseBody
    @GetMapping(value = "/dbbi_eat/getList")
    public DataVo<Dinebuildbaseinfo> getList(Integer page, Integer limit) {
        return dineBuildBaseInfoService.getList(page, limit);
    }

    @ResponseBody
    @PostMapping(value = "/dbbi_eat/add")
    public DataVo<Dinebuildbaseinfo> add(Dinebuildbaseinfo dinebuildbaseinfo) {
        return dineBuildBaseInfoService.add(dinebuildbaseinfo);
    }

    @GetMapping(value = "/dbbi_eat/{url}")
    public String redirect(@PathVariable("url") String url) {
        return "dbbi_eat/" + url;
    }
}